<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>list</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/main.css" type="text/css">
</head>
<style>
    td {
        text-align: center;
    }


</style>

<body>
<table  border="1" width="700" cellspacing="0" cellpadding="0" align="center">
    <caption aligin="center" valign="top"><font size="6"><b>学生信息表</b></font> </caption>

    <tr align="center">
        <td align="left" width="100">序号</td>
        <td align="left" width="100">学号</td>
        <td align="left" width="100">密码</td>
        <td align="left" width="100">姓名</td>
        <td align="left" width="200">edit</td>
    </tr>
    <c:forEach items="${page.datas}" var="vm">
        <tr align="center">
            <td align="left" width="100">${vm.studentId}</td>
            <td align="left" width="100">${vm.studentName}</td>
            <td align="left" width="100">${vm.studentPassword}</td>
            <td align="left" width="100">${vm.studentNickname}</td>
            <td align="left" width="300">
                <a href="${vm.studentId}/delete">删除</a>&nbsp;<a href="${vm.studentId}/update">修改</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="5">
            <a href="add" style="font-size: 24px">Add</a>
        </td>
    </tr>
    <tr>
        <c:choose>
            <c:when test="${page.pageIndex>0}">
                <td><a href="/list?Pageindex=${page.pageIndex-1}">上一页</a></td>
            </c:when>
            <c:otherwise>
                <td><a href="/list?Pageindex=${page.pageIndex}">上一页</a></td>
            </c:otherwise>
        </c:choose>

        <td>
            一共有${page.allPages}页<br>
            当前第[${page.pageIndex}]页
        </td>
        <td colspan="2" align="center">
            <c:forEach var="pages" items="${page.allPage}">
                <a href="/list?Pageindex=${pages}">${pages}</a>
            </c:forEach>
        </td>
        <c:choose>
            <c:when test="${page.pageIndex<page.allPages-1}">
                <td><a href="/list?Pageindex=${page.pageIndex+1}">下一页</a></td>
            </c:when>
            <c:otherwise>
                <td><a href="/list?Pageindex=${page.pageIndex}">下一页</a></td>
            </c:otherwise>
        </c:choose>
    </tr>
</table>

</body>
</html>
